<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="All feeds list"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <p><h:outputText value="#{feedController.count} messages"/></p>
                 <p><h:commandLink actionListener="#{feedController.getNewFeeds}">Update list!</h:commandLink></p>
                <hr />
                <h:dataTable value="#{feedController.messages}" var="msg">
                    <h:column>
                        <f:facet name="header">
                            Title
                        </f:facet>
                        <h:outputText value="#{msg.title}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            Link
                        </f:facet>
                        <h:outputLink value="#{msg.link}">#{msg.link}</h:outputLink>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            Description
                        </f:facet>
                        <h:outputText value="#{msg.description}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
        </ui:define>
        <ui:define name="footer"></ui:define>
    </ui:composition>
</html>


